package com.example.service.impl;

import com.example.dto.CireportDto;
import com.example.dto.ReportListDto;
import com.example.mapper.ReportMapper;
import com.example.pojo.Cidetailedreport;
import com.example.pojo.Cireport;
import com.example.pojo.Overallresult;
import com.example.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class ReportServiceImpl implements ReportService {
    @Autowired
    private ReportMapper reportMapper;
    @Autowired
    private ReportMapper cireportMapper;
    @Override
    public List<ReportListDto> getOrdersWithHospitalNames(String userId) {
        return reportMapper.getOrdersWithHospitalNames(userId);
    }
    @Override
    public CireportDto getCireportDetails(Integer orderId) {
        List<Cidetailedreport> cidetailedreportList = cireportMapper.selectCidetailedreportByOrderId(orderId);
        List<Overallresult> overallresultList = cireportMapper.selectOverallresultByOrderId(orderId);

        CireportDto dto = new CireportDto();
        dto.setCidetailedreportList(cidetailedreportList);
        dto.setOverallresultList(overallresultList);

        return dto;
    }

}
